package org.pay.core.service;

import org.pay.core.entity.PayOrder;

import java.util.List;
import java.util.Map;

/**
 * @author: yangshancheng
 * @date: 17/9/8
 * @description:
 */
public interface IPayOrderService {

    Map create(String jsonParam);

    Map select(String jsonParam);

    Map selectByMchIdAndPayOrderId(String jsonParam);

    Map selectByMchIdAndMchOrderNo(String jsonParam);

    Map updateStatus4Ing(String jsonParam);

    Map updateStatus4Success(String jsonParam);

    Map updateStatus4Complete(String jsonParam);

    Map updateNotify(String jsonParam);

    PayOrder findByPayOrderId(String payOrderId);

    PayOrder findByMchIdAndPayOrderId(Long mchId, String payOrderId);

    List<PayOrder> select(Long mchId, int offset, int limit, PayOrder payOrder);

    List<PayOrder> select(int offset, int limit, PayOrder payOrder);

    Integer count(Long mchId, PayOrder payOrder);

    Integer count(PayOrder payOrder);

    Integer count(PayOrder payOrder, List<Byte> statusList);

    int updateByPayOrderId(String payOrderId, PayOrder payOrder);

    Long sumAmount(PayOrder payOrder, List<Byte> statusList);

    List<PayOrder> select(String channelMchId, String billDate, List<Byte> statusList);

    int baseUpdateStatus4Ing(String payOrderId, String channelOrderNo);

    int baseUpdateStatus4Success(String payOrderId);

    int baseUpdateStatus4Success(String payOrderId, String channelOrderNo);

    int baseUpdateStatus4Success(String payOrderId, String channelOrderNo, String channelAttach);

    int baseUpdateStatus4Complete(String payOrderId);

    int baseCreatePayOrder(PayOrder payOrder);

    PayOrder baseSelectPayOrder(String payOrderId);

    PayOrder baseSelectByMchIdAndPayOrderId(Long mchId, String payOrderId);

    PayOrder baseSelectByMchIdAndMchOrderNo(Long mchId, String mchOrderNo);

    PayOrder baseSelectByMchOrderNo(String mchOrderNo);

    // 查询订单数据(用于生成商户对账文件使用)
    List<PayOrder> selectAllBill(int offset, int limit, String billDate);

}
